<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        // 封装模拟call 抄袭的，不会
        Function.prototype.mycall=function(context) {
            if(typeof this !='function') {
                throw new TypeError('not function')
            }
            context = context || window
            context.fn = this
            let arg = [...arguments].slice(1)
            let result = context.fn(...arg)
            delete context.fn
            return result
        }
    </script>
</body>

</html>